var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var heroConf = require('../../app/config/heroConf');
var config = require('../config');
var dataApi = require('../../app/libs/dataApi');

suite('测试heroConf', function () {
    suite('getHeroAttrLvConf', function () {
        test('获取英雄等级数据', function () {
            var hero_type_all_conf = dataApi.hero_type.all();
            _.each(hero_type_all_conf, function (hero_type_conf, hero_type) {
                assert.equal(heroConf.getHeroAttrLvConf(hero_type, 1) != null, true);
                assert.equal(heroConf.getHeroAttrLvConf(hero_type, 2) != null, true);
                assert.equal(heroConf.getHeroAttrLvConf(hero_type, 3) != null, true);
                assert.equal(heroConf.getHeroAttrLvConf(hero_type, 4) != null, true);
                assert.equal(heroConf.getHeroAttrLvConf(hero_type, 5) != null, true);
                assert.equal(heroConf.getHeroAttrLvConf(hero_type, 1000) == null, true);
            });
        });

        test('找不到英雄数据', function () {
            assert.equal(heroConf.getHeroAttrLvConf(100, 1) != null, false);
        });
    });

    suite('getHeroLvConf', function () {
        test('获取英雄等级数据', function () {
            assert.equal(heroConf.getHeroLvConf(60) != null, true);
        });
    });

    suite('getHeroPvpExp', function () {
        test('获取英雄等级经验', function () {
            heroConf.getHeroPvpExp(1).should.equal(20);
            heroConf.getHeroPvpExp(999).should.equal(0);
        });
    });
});
